package com.example.app2024.fragment;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.app2024.R;

public class Fragment_static extends Fragment
{
      private Button btn;
      private  TextView textView_self;

      @Nullable
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
      {

            View view = inflater.inflate(R.layout.fragmentdemo_static, container, false );
            btn = view.findViewById(R.id.btn_sfreturn);
            textView_self = view.findViewById(R.id.sf001);
            btn.setOnClickListener(new View.OnClickListener()
            {
                  @Override
                  public void onClick(View v)
                  {
                        TextView textView = getActivity().findViewById(R.id.tv_fr01);
                        textView.setText(textView_self.getText().toString());
                  }
            });

            return view;
      }
}
